package com.example.model;

import android.content.Context;
import android.database.Cursor;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class HistoryListAdapter extends BaseAdapter {
	private Context mContext;
	private Cursor mCursor;

	public HistoryListAdapter(Context context, Cursor cursor) {

		mContext = context;
		mCursor = cursor;
	}

	@Override
	public int getCount() {
		return mCursor.getCount();
	}

	@Override
	public Object getItem(int position) {
		return null;
	}

	@Override
	public long getItemId(int position) {
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		TextView mTextView = new TextView(mContext);
		mCursor.moveToPosition(position);
		mTextView.setText(mCursor.getString(1) + "-" + mCursor.getString(2)
				+ "-" + mCursor.getString(4) + "-" + mCursor.getString(5));
		return mTextView;
	}

}
